package com.clusterswisdom.horn.api.tmall.action.logistics;


import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.alibaba.fastjson.JSONObject;
import com.clusterswisdom.horn.api.ioc.HornAction;
import com.clusterswisdom.horn.api.ioc.HornResponse;
import com.clusterswisdom.horn.api.ioc.api.ApiConfig;
import com.clusterswisdom.horn.api.tmall.TmallInstance;
import com.clusterswisdom.horn.api.tmall.action.AbstractTmallAction;
import com.taobao.api.response.LogisticsOnlineSendResponse;

public class LogisticsOfflineSendAction extends AbstractTmallAction implements HornAction{
	private Logger log = LoggerFactory.getLogger(LogisticsOfflineSendAction.class);
	@Override
	public HornResponse execute(ApiConfig config, JSONObject param)
			throws Exception {
		LogisticsOnlineSendResponse response = (LogisticsOnlineSendResponse)TmallInstance.getInstance().executeRequest(param, "entityProduct", "logisticsOfflineSend");
		
		if(response.isSuccess()){
			
			return new HornResponse(true, response.getShipping());
		}else{
			
			return getUnsuccessResponse(response);
		}
	}
}
